<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>绝地求生列表页</title>
    <link rel="stylesheet" href="//js01.daoju.qq.com/zb/common/css/common.css?v=20170727" />
    <link rel="stylesheet" href="//js01.daoju.qq.com/zb/common/css/style.css" />
    <link rel="stylesheet" href="//mall.qq.com/fonts/iconfont.css" />
    <link rel="stylesheet" href="//js01.daoju.qq.com/zb/pubg/css/theme.css" />
</head>

<body>
    <div class="tou"></div>
    <div></div>
    <div class="mid">
        <div class="breadcrumb" id="blk_productlist_crumbs"> <span><a href="index.shtml" target="_blank"
                    class="ibcb-first" style="margin-right:0px;">首页&gt;</a></span>
            <span>
                <a href="javascript:;" style="margin-right:0px;cursor:default;text-decoration: none; color:#999">所有商品
                </a>
            </span>
        </div>


        <div class="page-main" style="margin-top: 160px;">

            <div class="list-filter">
                <div id="showip" class="fltbox gm-filter clearfix" style="display: none;">
                    <dl id="dj_ipclass_ul">


                    </dl>
                    <a href="javascript:;" class="btn-filter filter-sq">
                        <span>收起</span>
                        <i class="ico-comm i-arrtop"></i><!-- 箭头朝下 i-arrbot-->
                    </a>
                </div>
                <div id="showclass" class="fltbox clearfix">
                    <dl id="dj_class_ul">
                        <dt>分类：</dt>
                        <dd class="cur all" type="all" val="1">全部</dd>
                        <dd class="" type="cat" val="638">周年纪念礼盒</dd>
                        <dd class="" type="cat" val="804">家居日用</dd>
                    </dl>
                </div>

                <div class="fltbox sort-filter clearfix">
                    <dl class="sortdl fl">
                        <dt>排序：</dt>
                        <dd class="cur" type="sort" val="iRecRank" sort="desc">默认</dd>
                        <dd class="flt-arrow" type="sort" val="iPrice">
                            <span>价格</span>
                            <i class="ico-comm i-arrgray"></i><!-- 默认全灰点击下面变黑色添加i-arrbbot在点击上面变黑色i-arrbtop-->
                        </dd>
                        <dd class="flt-arrow" type="sort" val="dtShowBegin">
                            <span>新品</span>
                            <i class="ico-comm i-arrgray"></i><!-- 默认全灰点击下面变黑色添加i-arrbbot在点击上面变黑色i-arrbtop-->
                        </dd>
                        <dd class="flt-arrow" type="sort" val="iFavNum">
                            <span>人气</span>
                            <i class="ico-comm i-arrgray"></i><!-- 默认全灰点击下面变黑色添加i-arrbbot在点击上面变黑色i-arrbtop-->
                        </dd>
                        <dd class="flt-arrow" type="sort" val="iSoldNum">
                            <span>销量</span>
                            <i class="ico-comm i-arrgray"></i><!-- 默认全灰点击下面变黑色添加i-arrbbot在点击上面变黑色i-arrbtop-->
                        </dd>
                    </dl>
                    <dl class="sortdl fr">
                        <dt>筛选：</dt>
                        <dd class="flt-check" type="screen" val="2">
                            <i class="ico-comm i-check"></i><!-- 点击添加i-checked-->
                            <span>有货</span>
                        </dd>
                        <dd class="flt-check" type="screen" val="1">
                            <i class="ico-comm i-check"></i><!-- 点击添加i-checked-->
                            <span>包邮</span>
                        </dd>
                        <dd class="flt-check" type="screen" val="3">
                            <i class="ico-comm i-check"></i><!-- 点击添加i-checked-->
                            <span>聚豆可抵</span>
                        </dd>
                    </dl>
                </div>
            </div>


            <div class="good-list">
                <div id="dj1" style="display: none">
                    <div class="pro-none">
                        暂时没有商品呢，去首页看看吧
                    </div>
                </div>
                <ul class="clearfix" id="dj_goods_ul">
                    <div style="display: block; width: 300px; height: 300px;">
                        <img style="margin-left: 300px;"
                            src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1593691977546&di=4592b4f9c22feb87d0acf7940add5999&imgtype=0&src=http%3A%2F%2Fimg.yzcdn.cn%2Fupload_files%2F2018%2F05%2F26%2F38a20439cfe027a35c9b0844481f2310.gif"
                            alt="">
                    </div>

                </ul>

                <!-- 分页按钮  -->
                <div class="page pagesmar pagewth" id="page_wrapper"><span class="p_prev"><a
                            href="?page_no=1&amp;page_size=12"><i class="ico-center ico-arrleft"></i></a></span><span
                        class="page_btn active"><a page="1" href="?page_no=1&amp;page_size=12">1</a></span><span
                        class="p_next"><a href="?page_no=1&amp;page_size=12"><i
                                class="ico-center ico-arrright"></i></a></span></div>
            </div>

        </div>
    </div>
    <div class="wei"> </div>
    <script src="../js/jquery-1.10.1.min.js"></script>
    <script>
        $('.tou').load('head.html')
        $('.wei').load('footer.html')
        function que(name) {
            var search = location.search.replace('?', '');
            search = search.split('&')
            search = search.map((value) =>
                ({
                    key: value.split('=')[0],
                    value: value.split('=')[1]
                }))
            var data = search.filter(({ key }) => key === name)[0]
            return data ? data.value : ''
        }
        var username1 = que('username')//用户名
        var username = decodeURIComponent(username1)
        console.log(username);
        
        $.ajax({
            type: "POST",
            url: "http://localhost/lian/pubg/php/cha.php",
            data: {username},
            success: function (data) {
                var dd = JSON.parse(data)
                var html = ""

                dd.data.forEach(({ id, price, name, img }) => {
                    console.log(id);
                    html += ` <li>
                        <a  target="_blank" class="good-link">
                            <div class="ico-comm ">
                                <span class="mark-txt"></span>
                            </div>
                            <img src="${img}"
                                width="280" height="268" alt="商品图">
                            <div class="good-info">
                                <p class="good-name">${name}</p>
                                <div class="good-pri">
                                    <span class="new-pri">￥${price}.00</span>
                                    <span class="old-pri">￥499.00</span>
                                </div>
                            </div>
                        </a>
                    </li>`

                });
                $("#dj_goods_ul").html(html)
                $('.good-link').on("click",function(){
                    alert('本数据不是官网数据，只适用模糊搜索，未做购物车，想看购物车 不要soso')
                })


            }
        })

    </script>
</body>

</html>